<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>新增</title>
    <script src="../../js/jpuery/jquery.js"></script>
    <script src="../../js/vue/vue.js"></script>
</head>
<body>
    <div id="app">
        <form id="editFrom">
            用户名：<input name="name"><br/>
            年  龄：<input name="age"><br/>
            <input type="button" value="提交" @click="add()">
        </form>
    </div>
    <script>
        var vue = new Vue({
            el:"#app",
            data:{

            },
           methods:{
                add:function () {
                    $.post("http://localhost:9000/employees/add",$("#editFrom").serialize(),function (data) {
                        if (data.code == 200){
                            window.location.href="list.html"
                        }
                    })
                }
           }
        });

    </script>
</body>
</html>